﻿-- =============================================
-- Author:		Daniel Sepp
-- Create date: June 1, 2013
-- Description:	Retrieves basic metrics for itinerary instances
-- =============================================
CREATE PROCEDURE [dbo].[GetItineraryInstanceCounts] 
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	SELECT      NEWID() AS MetricId, ItineraryName, COUNT(ItineraryName) AS InstanceCount, MIN(TimeStamp) as TimeStamp
	FROM        dbo.bam_ItineraryActivity_AllInstances
	GROUP BY ItineraryName
END

GO
